<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
    <script>
        xo = 'one';
        function f1() {
            console.log(xo);
        }
        function f2() {
            var xo = 'two';
            return f1;
        }
        var ret = f2();
        ret();
    </script>
</body>
</html>